using System;
namespace AppToolKit.Core.Xml
{
	public class ElementHandler : IElementHandler
	{
		public StartElementHandler StartElementHandler
		{
			get;
			set;
		}
		public EndElementHandler EndElementHandler
		{
			get;
			set;
		}
		public AttributeHandler AttributeHandler
		{
			get;
			set;
		}
		public object OnStartElement(object paranet)
		{
			object result;
			if (this.StartElementHandler != null)
			{
				result = this.StartElementHandler(paranet);
			}
			else
			{
				result = null;
			}
			return result;
		}
		public void OnEndElement(object parent, object owner)
		{
			if (this.EndElementHandler != null)
			{
				this.EndElementHandler(parent, owner);
			}
		}
		public void OnElement(object instance, string value)
		{
			throw new NotImplementedException();
		}
		public void OnAttribute(object instance, string element, string name, string value)
		{
			if (this.AttributeHandler != null)
			{
				this.AttributeHandler(instance, element, name, value);
			}
		}
	}
}
